//
//  TimeTextfield.swift
//  AESOLAR_IOS
//
//  Created by Mr.Wang on 2019/10/28.
//  Copyright © 2019 Mr.Wang. All rights reserved.
//

import UIKit

class TimeTextfield: UIView {
    
    let timeLabel = UILabel()
    var date = ""
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.backgroundColor = .white
        
        let placeHolderLabel = UILabel()
        placeHolderLabel.text = "购买时间（非必填）".localized
        placeHolderLabel.setContentHuggingPriority(.required, for: .horizontal)
        placeHolderLabel.font = UIFont.systemFont(ofSize: 14, weight: .medium)
        placeHolderLabel.textColor = #colorLiteral(red: 0.7490196078, green: 0.7490196078, blue: 0.7490196078, alpha: 1)
        self.addSubview(placeHolderLabel)
        placeHolderLabel.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.left.equalTo(15)
        }
        
        let imageView = UIImageView()
        imageView.contentMode = .scaleAspectFit
        imageView.image = UIImage.init(named: "right_arrow")
        self.addSubview(imageView)
        imageView.snp.makeConstraints { (make) in
            make.right.equalTo(-15)
            make.width.equalTo(10)
            make.height.equalTo(15)
            make.centerY.equalToSuperview()
        }
        
        timeLabel.text = "XX-XX-XX"
        timeLabel.textAlignment = .right
        timeLabel.font = UIFont.systemFont(ofSize: 14, weight: .medium)
        timeLabel.textColor = #colorLiteral(red: 0.8549019608, green: 0.8549019608, blue: 0.8549019608, alpha: 1)
        self.addSubview(timeLabel)
        timeLabel.snp.makeConstraints { (make) in
            make.right.equalTo(imageView.snp.left).offset(-10)
            make.centerY.equalToSuperview()
        }
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
